package study.java.thread06;

/**
* @Name: SetStudentRunnable
* @Description: 生产学生数据类
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-1-9 下午4:52:48 
* @Version: V1.0
 */
public class SetStudentRunnable02 implements Runnable {
	
	private Student02 student ;
	private int x = 0 ;

	public SetStudentRunnable02(Student02 student) {
		this.student = student;
	}

	@Override
	public void run() {
		while(true) {
			//生产数据
			if(x % 2 == 0) {
				student.set("张三", 21) ;
			} else {
				student.set("李四", 27) ;
			}
			x++ ;
		}
	}
	
}
